

import java.util.Scanner;

class RecType {
    int key;
    String data;

    public RecType(int key) {
        super();
        this.key = key;
    }
}

class SortList {
    RecType[] R;
    int n;

    public SortList(int[] r) { //用数组创建线性表
        super();
        R = new RecType[r.length+1];
        for(int i=0;i<r.length;i++)
            R[i] = new RecType(r[i]);
        n = r.length;
    }

    public void Disp() {  //输出线性表的元素
        for(int i=0;i<n;i++)
            System.out.printf(R[i].key+" ");
        System.out.println();
    }

    void InsertSort() {
        for (int i = 0; i < n - 1; i++) {
            int end = i;
            int tem = R[end + 1].key;
            while(end>=0)
            {
                if (tem < R[end].key)
                {
                    R[end + 1].key = R[end].key;
                    end--;
                }
                else
                {
                    break;
                }
            }
            R[end  + 1].key = tem;

            Disp();
        }

    }
    }
public class Main {
    public static void main(String[] args) {
        // TODO Auto-generated method stub
        Scanner sc = new Scanner(System.in);
        int n  = sc.nextInt();
        int a[]=new int[n];
        for(int i=0;i<n;i++)
            a[i] = sc.nextInt();
        SortList  ss = new SortList(a);
        ss.InsertSort();
        sc.close();
    }
}


